#include <iostream>
using std::cout;
using std::endl;

template <class T1 = int,class T2 = int>
T1 add(T2 t1,T2 t2)
{
    return t1 + t2;
}

void test0(){
    double num = 2.6;
    double num2 = 3.8;
    //隐式实例化无法正确使用
    //必须进行指定，也尽量只去指定必要的模板参数
    cout << add<double>(num,num2) << endl;
    cout << add<double,int>(num,num2) << endl;

    cout << add(num,num2) << endl;
}

int main(void){
    test0();
    return 0;
}
